====== General Allee Effect ======

\( \require{AMSsymbols} \)
\( \require{newcommand} \)
\( \newcommand{\diff}[2]{\frac{d{#1}}{d{#2}}} \)

<div download round right 25%>
Analysis in ''Research\Current\matingLogistics\generalallee20110401.nb''.
</div>

I've been working on deriving a general [[..:..:Reaction Kinetics:start]] formalism to extend the logistic equation. I've made progress there, having derived a //wicked ugly// dynamical equation for \(dn/dt\) vs. \(n\).  So what to do with it?  It would be good to get it into an (approximate?) expression that is more meaningful and workable.  So let's consider any general rate equation,
\[
  \diff{n}{t} = f(n).
\]
There are some good reasons((just trust me)) to restrict the form of \(f(n)\) a bit:
\[
  f(n) = f_0 + g(n) n.
\]
Effectively, this is just a smoothness condition on \(f\) near \(n=0\).

Our goal is to translate \(f\) into a simpler, more meaningful, form.  Let's choose
<div right><BOOKMARK:eq_1>(Eq. 1)</div>
\[
  f(n) = f_0 + r(n) n a(n) \left( 1 - \frac{n}{K} \right)
\]
for some functions \(r(n)\) and \(a(n)\).  Equivalently,
\[
  g(n) = r(n) a(n) \left( 1 - \frac{n}{K} \right).
\]

For the remainder of this analysis we will assume \(f_0=0\) and \(K>0\) is known.  We should be able to expand the analysis to small positive \(f_0\) later, through a series expansion, to see how it shifts the quantities of interest.  But general \(f_0\) is difficult because it opens up the dynamics to more qualitative solutions.
====== Allee function ======

This is a desirable form because it lets us separate out the Allee effect from the rest of the dynamics.  Our function \(f\) is similar to the logistic equation (which lacks an Allee effect), \(f(n) = r n (1-n/K)\), so some of the terms (\(r\) & \(K\)) are easily interpreted.

<div right round box>
{{:research:draft:general_allee:generalallee20110422.png?600}}

Figure 1: Shape of the Allee function \(a(n)\) for various Allee powers, \(A\).
</div>
We can let \(r(n)\) be a general function but restrict \(a(n)\) so that it //looks// like an Allee effect.  The Allee effect represents a reduced per-capita population growth rate for low densities.  Let's choose a functional form for \(a\) that captures the behaviour we're looking for:
\[
  a(n) \equiv (1-A) + A \frac{1}{1+n_{1/2}/n}
\]
where the parameter \(A\)--the //Allee power//--represents the strength of the Allee effect.  Then \(a(0)=1-A\) and asymptotically approaches \(a(+\infty)=1\).  \(n_{1/2}\) indicates the //half-max density//--where the Allee effect is halfway between its limits.  A useful related parameter is \(n_0\equiv (A-1) n_{1/2}\)--the //Allee density//--an unstable equilibrium density.  If \(n<n_0\) the population will collapse due to the Allee effect.  If we assume \(n_{1/2}>0\) then \(n_0>0\) only when \(A>1\), a //strong// Allee effect.

If we assume \(r(n)\approx\text{constant}>0\) then the interpretation of the Allee function becomes clear:
^  Allee power, \(A\)  ^     \(a(n=0)\)     ^ Interpretation                                                               ^
|       \(A=0\)        |     \(a(0)=1\)     | No Allee effect                                                              |
|   \( 0<A\leq 1 \)    |  \(0\leq a(0)<1\)  | Weak Allee effect, per-capita growth slowed for \(0\leq n\lesssim n_{1/2}\)  |
|       \(1<A\)        |     \(a(0)<0\)     | Strong Allee effect, population collapses for \(0\leq n\lesssim n_0\)        |



For given \(g(n)\) & \(a(n)\) we can isolate the unknown \(r(n)\) in this equation,
\[
  r(n) = \frac{g(n)}{a(n) (1 - n/K)}.
\]

====== Series expansion ======

So far we've just shuffled things around--hiding the complexity of \(f(n)\) in \(r(n)\)--but it's still not tractable.  But we can sacrifice accuracy for clarity by recognizing that we're most interested in what happens near \(n=0\).  That's when the intrinsic growth rate \(r\) in the logistic equation and the deviation due to the Allee effect become important.  So let's take a series expansion around \(n=0\):
\[
  r(n) \approx \frac{g_0}{1-A} + r_1 n + r_2 n^2 + r_3 n^3 + \cdots
\]
where the parameters \(r_i\) can be expressed in terms of \(A\), \(n_{1/2}\), \(K\), and the derivatives of \(g\) at \(n=0\).  

Since \(A\) and \(n_{1/2}\) are free parameters we can choose them as we like. If we want to preserve the interpretation of \(r(n)\) as the intrinsic growth rate it should be slowly varying near \(n=0\).  We can't make it completely flat but we can choose \(A\) and \(n_{1/2}\) so that \(r_1=r_2=0\).  The necessary constants are
<div right><BOOKMARK:eq_2>(Eq. 2)</div>
\[
\begin{array}{rcl}
  A & \equiv & -\frac{2 \left(g(0)+K g'(0)\right)^2}{K \left(-2 g'(0) \left(g(0)+K g'(0)\right)+K g(0) g''(0)\right)} \\
  n_{1/2} & \equiv & -\frac{2 K \left(g(0)+K g'(0)\right)}{2 g(0)+K \left(2 g'(0)+K g''(0)\right)}.
\end{array}
\]

We can also use the series expansion to check our accuracy.  Let's truncate the series after the zeroth-order term, \(r(n)\approx g(0)/(1-A)\).  Then the \(n^3\) term provides an error estimate.  As long as its magnitude is insignificant compared to \(g(0)/(1-A)\) then we can be confident the approximation is good.  The condition can be reduced to \(n\ll n_{err}\) where 
<div right><BOOKMARK:eq_3>(Eq. 3)</div>
\[
  n_{err} \equiv \left[ \frac{144 K^2 g(0)^2 \left(g(0)+K g'(0)\right)^2}{\left(3 g''(0) \left(2 g(0)+K \left(2 g'(0)+K g''(0)\right)\right)-2 K \left(g(0)+K g'(0)\right) g^{(3)}(0)\right)^2} \right]^{1/6}.
\]

In this notation
\[
  r(n) \approx \frac{g(0)}{1-A} \left( 1 \pm \left(\frac{n}{n_{err}}\right)^3+ \cdots \right).
\]

===== Approximate carrying capacity =====

If possible, the carrying capacity \(K\) should be solved analytically from \(g(K)=0\).  If intractable a series approximation may be adequate:
\[
  0 \approx g(0) + g'(0) K + \frac{1}{2} g''(0) K^2 + \frac{1}{3!} g^{(3)}(0) K^3 + \cdots.
\]
We can use our solutions of \(A\) and \(n_{1/2}\) from above to inform the necessary order of the approximation.  For example, if we truncate after order one then \(K\approx -g(0)/g'(0)\) which results in \(A\approx 0\).  Since we don't expect this to be generally true, we should continue to a higher order approximation.  Truncating after second order doesn't help: we find \(A\approx 1\).  So we are required to continue to third order, giving
<div right><BOOKMARK:eq_4>(Eq. 4)</div>
\[
  K \approx \frac{1}{g^{(3)}(0)}\left(-g''(0)+\left(g''(0)^2-2 g'(0) g^{(3)}(0)\right)/C+C\right)
\]
where
\[
\begin{array}{rcl}
  C & \equiv & \left(-g''(0)^3+3 g'(0) g''(0) g^{(3)}(0)-3 g(0) g^{(3)}(0)^2+R\right)^{1/3}\\
  R & \equiv & \sqrt{g^{(3)}(0)^2 \left(-3 g''(0)^2 \left(g'(0)^2-2 g(0) g''(0)\right)+2 g'(0) \left(4 g'(0)^2-9 g(0) g''(0)\right) g^{(3)}(0)+9 g(0)^2 g^{(3)}(0)^2\right)}.
\end{array}
\]

Truncation also gives us an error estimate because, considering the next higher order term, we find
\[
  0 \approx g(0) + g'(0) K + \frac{1}{2} g''(0) K^2 + \frac{1}{3!} g^{(3)}(0) K^3 \left(1 \pm \frac{K}{K_{err}} + \cdots \right)
\]
where 
\[
  K_{err} \equiv 4 \left| \frac{g^{(3)}(0)}{g^{(4)}(0)} \right|.
\]
Our approximate solution is valid when \(\left| K \right| \ll K_{err}\).

====== Series expansion with carrying capacity ======

The technique above is useful if the carrying capacity, \(K\) is known.  But it gets a bit muddled to give \(K\) a special role if it's just another unknown parameter, along with \(A\) and \(n_{1/2}\).  Then we should just do a higher order expansion to solve for all three simultaneously.

The solutions come out to
\[
\begin{array}{rcl}
  n_{1/2} & \equiv & -\frac{3 g''(0)}{g^{(3)}(0)} \\
  K & \equiv & -\frac{g(0)+n_{1/2} g'(0) \pm \sqrt{\left(g(0)-n_{1/2} g'(0)\right)^2-2 n_{1/2}^2 g(0) g''(0)}}{2 g'(0)+n_{1/2} g''(0)} \\
  A & \equiv & 1-\frac{K g(0)}{(K+n_{1/2}) g(0)+K n_{1/2} g'(0)}.
\end{array}
\]

The first problem here is there are two roots for \(K\).  Which one should we take?  I think it's arbitrary but one reasonable criterion would be that \(n=K\) is //stable// when \(K>0\).  

<WRAP center round important 60%>
Now I just gotta figure out what that means in terms of the roots. --- //[[rik.blok@ubc.ca|Rik Blok]] 2012-01-20 23:13//
</WRAP>


====== Summary ======

For a rate equation, \(dn/dt = f(n) = g(n) n\) (assuming \(f_0=0\) in [[#Eq. 1]]) we approximate \(g(n)\) with
\[
  g(n) \approx r(n) \left( 1-A + \frac{A}{1+n_{1/2}/n} \right) \left( 1 - \frac{n}{K} \right).
\]
By choosing \(A\) and \(n_{1/2}\) as per [[#Eq. 2]] we find
\[
  r(n) \approx \frac{g(0)}{1-A} = \text{constant}
\]
which can be interpreted as the population's //intrinsic growth rate// in the absence of an Allee effect when \( \left| n \right| \ll n_{err}\) as defined in [[#Eq. 3]].

The remaining parameter, \(K\) is the solution to \(g(K)=0\).  If an exact solution is not forthcoming, an approximation is given in [[#Eq. 4]].

<div right round info>
FIXME

Next time:
  * Plug my [[:research:reaction_kinetics:simple_2-states:start]] solution in and see what I get.
  * Can I find compact expressions for the parameters?  What if I zero out a subset of the parameters?

 --- //[[rik.blok@ubc.ca|Rik Blok]] 2011-04-08 17:24//
FIXME
</div>

====== Alternate Allee formulation ======

In [[http://www.ese.u-psud.fr/epc/conservation/PDFs/AlleeCorrected.pdf | another place]]((Equation 3.3 on page 67)) I found the Allee effect represented as
\[
  a_C(n) \equiv 1 - \frac{n_A + n_C}{n + n_C}.
\]
It may not be immediately obvious but this is mathematically identical to my formulation.  The mapping of parameters is
\[
\begin{array}{rcl}
  n_{1/2} & \equiv & n_C \\
  A & \equiv & \frac{n_A}{n_C} + 1.
\end{array}
\]

====== Closed form solution ======

The general Allee formulation is useful because it has a closed form solution (in the form of an [[wp>implicit function]]).  If 

\[
\diff{n}{t} = r n \left( \frac{n-n_A}{n+n_C} \right) (1-n/K)
\]
then \(n(t)\) satisfies
\[
\frac{(1 - n_A/n(t))^{\gamma_A}}{(1 - K/n(t))^{\gamma_K}} = \frac{(1 - n_A/n_0)^{\gamma_A}}{(1 - K/n_0)^{\gamma_K}} e^{r t}
\]
where \(n(0)=n_0\) and
\[
\begin{array}{rcl}
  \gamma_A & = & \frac{K (n_A + n_C)}{n_A (K - n_A)} \\
  \gamma_K & = & \frac{n_A (K + n_C)}{n_A (K - n_A)} = \frac{K+n_C}{K-n_A}.
\end{array}
\]

Unfortunately, the solution isn't as helpful as we would like because it can't be solved explicitly.  Instead, numerical techniques (eg. [[wp>Newton's method]]) are required.